import { EventEmitter } from "events";

export default class Application extends EventEmitter {
  constructor() {
    super();
    this.$toast = document.createElement('div');
    this.$notify = document.createElement('div');
    this.$modal = document.createElement('div');
    this.$toast.classList = "toast";
    this.$notify.classList = "notify";
    this.$modal.classList = "modal";
  }

  toast() {

  }

  notify() {

  }

  modal() {

  }

  get currentPage () {
    throw new Error("Not Implemented")
  }

  mount($el) {
    
    this.$root = $el;

    let page = this.currentPage;
    this.$root.appendChild(page.render());
    document.body.appendChild(this.$toast);
    document.body.appendChild(this.$modal);
    document.body.appendChild(this.$notify);
  }
}